﻿<%@ Page Language="C#" MasterPageFile="~/Shared/OneColumn.Master" AutoEventWireup="true"
    CodeBehind="MyLearning.aspx.cs" Inherits="SharingCenter.Web.Mod.Learning.MyLearning"
    ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    我的互助活动
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .avatarthumbcontainer
        {
            width: 100px;
        }
        #leftpart
        {
            width: 550px;
        }
        #rightpart
        {
            padding-left: 570px;
        }
        
        .profile
        {
            padding-left: 120px;
            font-size: 14px;
        }
        
        .skilltext
        {
        	color:Green;
        	font-weight:bold;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Mod/Learning/MyLearning.js" />
        </Scripts>
    </asp:ScriptManagerProxy>
    <myuc:GenericTabs SelectedItem="2" runat="server" Section="Learning" />
    <asp:ListView ID="ListView1" runat="server" DataSourceID="LinqDataSource1" DataKeyNames="LearningHistoryId"
        InsertItemPosition="None">
        <LayoutTemplate>
            <div runat="server" id="itemPlaceholder" />
        </LayoutTemplate>
        <ItemTemplate>
            <br />
            <h2 class="w5">
                <asp:Label ID="lblStatus" runat="server" ToolTip="状态: "></asp:Label>
                <span class="iconlabel">我和
                    <cc:NickNameLink ID="NickNameLink1" runat="server" CssClass="theotheruser" />
                    的互助活动</span> <span>(<asp:Literal ID="lblStatusText" runat="server" />)</span>
            </h2>
            <div class="fc">
                <div class="left ctn-p-r bdr-r" id="leftpart">
                    <asp:Panel runat="server" ID="pnAction" class="textcenter ctn1">
                        <span class="openmodalformbutton-nostyle pointer">
                            <asp:Image ImageUrl="~/Content/images/lap.png" AlternateText="结束互助" runat="server" />
                        </span>
                    </asp:Panel>
                    <h3 class="w7">
                        我的互助信息</h3>
                    <div class="fc">
                        <div class="left">
                            <myuc:ThumbAvatar ID="ThumbAvatar1" runat="server" />
                        </div>
                        <div class="profile">
                        <%try
                          { %>
                          <%if (this.myProfile.StartDate.HasValue)
                            { %>
                            <div>
                                在
                                <%=this.myProfile.StartDate.Value.ToShortDateString()%>
                                到
                                <%=this.myProfile.EndDate.Value.ToShortDateString()%>
                                期间
                            </div>
                            <%}
                          }
                          catch { } %>
                            <div>
                                <span>想学：</span> <span>
                                    <asp:ListView runat="server" ID="lvMySkillsInput">
                                        <ItemTemplate>
                                            <asp:Label Text='<%#Eval("Skill") %>' CssClass="skilltext" runat="server" />&nbsp;
                                        </ItemTemplate>
                                        <LayoutTemplate>
                                            <asp:Label runat="server" ID="itemPlaceholder" />
                                        </LayoutTemplate>
                                    </asp:ListView>
                                </span>
                            </div>
                            <div>
                                <span>能教：</span> <span>
                                    <asp:ListView runat="server" ID="lvMySkillsOutput">
                                        <ItemTemplate>
                                            <asp:Label CssClass="skilltext" Text='<%#Eval("Skill") %>' runat="server" />&nbsp;
                                        </ItemTemplate>
                                        <LayoutTemplate>
                                            <asp:Label runat="server" ID="itemPlaceholder" />
                                        </LayoutTemplate>
                                    </asp:ListView>
                                </span>
                            </div>
                        </div>
                    </div>
                    <h3 class="w7">
                        互助伙伴的互助信息</h3>
                    <div class="fc">
                        <div class="left">
                            <myuc:ThumbAvatar ID="otherAvatar" runat="server" />
                        </div>
                        <div class="profile">
                            <%try
                              { %>
                            
                            <%if (this.otherProfile.StartDate.HasValue)
                              { %>
                              <div>
                                在
                                <%=this.otherProfile.StartDate.Value.ToShortDateString()%>
                                到
                                <%=this.otherProfile.EndDate.Value.ToShortDateString()%>
                                期间
                            </div>
                            <%}
                              }
                              catch { } %>
                            <div>
                                <span>能教：</span> <span>
                                    <asp:ListView runat="server" ID="lvOtherSkillsOutput">
                                        <ItemTemplate>
                                            <asp:Label CssClass="skilltext" Text='<%#Eval("Skill") %>' runat="server" />&nbsp;
                                        </ItemTemplate>
                                        <LayoutTemplate>
                                            <asp:Label runat="server" ID="itemPlaceholder" />
                                        </LayoutTemplate>
                                    </asp:ListView>
                                </span>
                            </div>
                            <div>
                                <span>想学：</span> <span>
                                    <asp:ListView runat="server" ID="lvOtherSkillsInput">
                                        <ItemTemplate>
                                            <asp:Label CssClass="skilltext" Text='<%#Eval("Skill") %>' runat="server" />&nbsp;
                                        </ItemTemplate>
                                        <LayoutTemplate>
                                            <asp:Label runat="server" ID="itemPlaceholder" />
                                        </LayoutTemplate>
                                    </asp:ListView>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            <div id="rightpart">
                <div>
                    <h3 class="w7">
                        互助历史记录
                    </h3>
                    <ul>
                        <asp:PlaceHolder runat="server" Visible='<%#Convert.ToBoolean(Eval("RequestorSignOff")) %>'>
                            <li>
                                <div class="ctn1">
                                    <cc:NickNameLink UserId='<%#Eval("RequestorUserId")%>' runat="server" />于<asp:Label
                                        ID="Label2" runat="server" Text='<%#Eval("RequestorSignOffDate", "{0:MM-dd HH:mm决定结束互助。}") %>'></asp:Label>
                                </div>
                                <div class="hr1">
                                </div>
                            </li>
                        </asp:PlaceHolder>
                        <asp:PlaceHolder ID="PlaceHolder1" runat="server" Visible='<%#Convert.ToBoolean(Eval("RequesteeSignOff")) %>'>
                            <li>
                                <div class="ctn1">
                                    <cc:NickNameLink ID="NickNameLink2" UserId='<%#Eval("RequesteeUserId")%>' runat="server" />于<asp:Label
                                        ID="Label3" runat="server" Text='<%#Eval("RequesteeSignOffDate", "{0:MM-dd HH:mm决定结束互助。}") %>'></asp:Label>
                                </div>
                                <div class="hr1">
                                </div>
                            </li>
                        </asp:PlaceHolder>
                        <li>
                            <div class="ctn1">
                                <asp:Label ID="Label1" runat="server" Text='<%#Eval("CreateDate", "{0:MM-dd}") %>'></asp:Label>
                                起我和 <span class="theotheruserc"></span>开始了互助旅程。
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            </div>
            <asp:PlaceHolder ID="phScore" runat="server">
                <div class="dialogform" title="结束互助">
                    <div class="ctn-p-b">
                        <div class="nss ns-info">
                        </div>
                        结束了这次互助历程，给互助伙伴写一点感想吧！
                    </div>
                    <asp:TextBox runat="server" Rows="5" ID="txtComment" TextMode="MultiLine" Width="300" />
                    <%--<myuc:Editor runat="server" ID="Editor1" Width="300" Height="100" EditorType="Simple" />--%>
                    <div>
                        给互助伙伴做一个评价吧！
                        <div style="width: 300px" class="scorediv">
                            <asp:HiddenField ID="SelectedScore" runat="server" />
                            <table class="nop tb-full">
                                <tr>
                                    <td>
                                        <asp:RadioButton ID="s3" GroupName="ScoreRadio" runat="server" CssClass="left" />
                                        <div class="nss ns-flower">
                                        </div>
                                        大红花
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="s2" GroupName="ScoreRadio" runat="server" CssClass="left" />
                                        <div class="nss ns-smile">
                                        </div>
                                        笑脸
                                    </td>
                                    <td>
                                        <asp:RadioButton ID="s1" GroupName="ScoreRadio" runat="server" CssClass="left" />
                                        <div class="nss ns-shakehand">
                                        </div>
                                        握手
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="actionarea">
                        <asp:CustomValidator ID="CustomValidator1" ValidationGroup="Score" runat="server"
                            Display="Dynamic" ClientValidationFunction="SelectScore"></asp:CustomValidator>
                        <asp:LinkButton ValidationGroup="Score" ID="btnSignOff" CommandName="SignOff" runat="server"
                            CssClass="submitbutton">结束互助</asp:LinkButton>
                    </div>
                </div>
            </asp:PlaceHolder>
        </ItemTemplate>
        <EmptyDataTemplate>
            <span class="litetext">暂时你没有进行互助交换，现在快去<a href="CreateProfile.aspx">创建</a>你的互助活动吧！</span>
        </EmptyDataTemplate>
    </asp:ListView>
    <div class="ctn-p-t">
        <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="1"
            QueryStringField="p">
            <Fields>
                <asp:NextPreviousPagerField FirstPageText="首" PreviousPageText="上一个" ShowFirstPageButton="True"
                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                <asp:NumericPagerField />
                <asp:NextPreviousPagerField LastPageText="末" NextPageText="下一个" ShowLastPageButton="True"
                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
            </Fields>
        </asp:DataPager>
    </div>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="SharingCenter.Web.Classes.scDataContext"
        EnableUpdate="True" TableName="Sc_LearningHistories" OrderBy="CreateDate desc, RequestorSignOffDate desc, RequesteeSignOffDate desc">
    </asp:LinqDataSource>
</asp:Content>
